package lesson1.com.transportation;

public abstract class Vehicle {
    public static final int LAND = 1;
    public static final int SEA = 2;
    public static final int AIR = 3;
    
    private int vehicleType;
    
    public Vehicle(int vehicleType){
        switch (vehicleType){
            case LAND:
            case AIR:
            case SEA:
                this.vehicleType = vehicleType;
                break;
            default:
                System.out.println("Bad value for passed vehicle type: " + vehicleType + ". Using LAND.");
                this.vehicleType = LAND;
        }
        //System.out.println("A vehicle is born");
    }
    
    public int getVehicleType(){
        return vehicleType;
    }
    
    public String getDetails(){
        String details = "I am a vehicle of type: ";
        switch(this.vehicleType){
            case LAND:
                details = details + "land";
                break;
            case SEA:
                details = details + "sea";
                break;
            case AIR:
                details = details + "air";
                break;
            default:
                details = details + " (unknown vehicle type)";
        }
        
        return details;
    }
}